/**
 * Created with IntelliJ IDEA.
 * Description: leetcode.简单题.最大连续1的个数
 */

class Solution {
    public int findMaxConsecutiveOnes(int[] nums) {
        int max = 0;
        int count = 0;
        for(int i = 0; i < nums.length; i++) {
            if(nums[i] == 1){
                count++;
            }else{
                if(count > max){
                    max = count;
                }
                count = 0;
            }
        }
        if(count > max){
            max = count;
        }
        return max;
    }
}

public class Test {

}
